package com.diudiutechnology.www.yadiudiu.yadiudiu.mine.MyActivity;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.diudiutechnology.www.yadiudiu.R;
import com.diudiutechnology.www.yadiudiu.util.utils.UserInfoUtils;
import com.diudiutechnology.www.yadiudiu.yadiudiu.mine.MyActivity.CashWithdrawalActivity;
import com.diudiutechnology.www.yadiudiu.yadiudiu.mine.MyActivity.RechargeActivity;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * Created by Administrator on 2017/8/22.
 * 我的余额
 */

public class TheBalanceOfMyActivity extends Activity implements View.OnClickListener {
    @Bind(R.id.retur)
    LinearLayout retur;

    @Bind(R.id.money)
    TextView money;

    @Bind(R.id.layout_recharge)//充值
    RelativeLayout layout_recharge;

    @Bind(R.id.layout_cash_withdrawal)//提现
            RelativeLayout layout_cash_withdrawal;

    Context context;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_the_balance_of_my);
        ButterKnife.bind(this);
        context=this;
        initView();
    }

    private void initView() {
        retur.setOnClickListener(this);
        money.setText(UserInfoUtils.getInstans().readUserInfo(context).getBalance()+"元");
        layout_recharge.setOnClickListener(this);
        layout_cash_withdrawal.setOnClickListener(this);
    }
    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.retur:
                finish();
                break;
            case R.id.layout_recharge://充值
                startActivity(new Intent(context,RechargeActivity.class));
                break;
            case R.id.layout_cash_withdrawal://提现
                startActivity(new Intent(context,CashWithdrawalActivity.class));
                break;

        }
    }
}
